﻿@model IEnumerable<HotelManageSystem.Models.DeliveryorderModel>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutWarehouse.cshtml";
}
@section Head
{
     <link href= "@Url.Content("~/Content/TelerikGrid.css")"rel="stylesheet" type="text/css" />
}
@{
   Html.Telerik().Grid(Model)
       .Name("Grid")
       .DataKeys(keys=>keys.Add(d=>d.ID))
       .ToolBar(commands => commands.Custom().Text("填写出库单").Action("Creat", "Deliveryorder"))
       .DataBinding(dataBinging=>dataBinging.Ajax()
               .Select("TelerikAjax","Deliveryorder")
               .Delete("Delete", "Deliveryorder"))
        .Sortable(sorting => sorting
                                     .SortMode(GridSortMode.SingleColumn)
                                     .OrderBy(sortOrder => sortOrder
                                                               .Add((string) ViewData["sortMember"])
                                     ))
            .Pageable(paging => paging
                                    .Style(GridPagerStyles.NextPreviousAndNumeric)
                                    .Position(GridPagerPosition.Bottom)
                                    .PageTo((int) ViewData["currentPage"])
                                    .PageSize(10))
          .Columns(columns=>
                       {
                           columns.Bound(d => d.DeliveryorderID).Width(300);
                           columns.Bound(d => d.Product).Width(150);
                           columns.Bound(d => d.Outprice).Width(100);
                           columns.Bound(d => d.Count).Width(100);
                           columns.Bound(d => d.Total).Width(100);
                           columns.Bound(d => d.Billproducer).Width(100);
                           columns.Bound(d => d.time).Width(130).Format("{0:d}");
                           columns.Bound(d => d.Employee).Width(100);
                           columns.Command(commands =>
                                               {
                                                   commands.Custom("EditDeliveryorder")
                                                       .Text("修改")
                                                       .SendDataKeys(true)
                                                       .Action("Edit", "Deliveryorder");
                                                   commands.Delete();
                                               }).Width(200);


                       })
                       .Groupable()
                       .Filterable()
                       .Scrollable(scrolling => scrolling.Height(320))
                       .Selectable()
                       .Render();
    
}

              
   